﻿using System;


namespace Generic
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Init Person
            Person people = new Person()
            {
                ID = 11,
                Name = "山冈"
            };
            Japanese japanese = new Japanese()
            {
                ID = 112,
                Name = "鬼子"
            };

            Chinese chinese = new Chinese()
            {
                ID = 123,
                Name = "口口"
            };
            Hubei hubei = new Hubei()
            {
                ID = 123,
                Name = "pig猪"
            }; 
            #endregion

            //泛型方法
            GenericMethod.Show<Hubei>(hubei);
            // <Hubei> 可以省略
            GenericMethod.Show(hubei);
            Console.WriteLine("**************************");



//            泛型类
           ChildClass child =new ChildClass();

           ChildClass<string> child1 = new ChildClass<string>();
           child1.MyInterFace(" string ");

           ChildClass<Person> child2 = new ChildClass<Person>();
           child2.MyInterFace(people);

           ChildClass<Person,Chinese> child3 = new ChildClass<Person, Chinese>();
           child3.MyInterFace(people);

            Console.ReadKey();
            

        }
    }
}
